data the data frame: Replace values across a data frame
Description
Replace all occurrences of given values in all columns of a data frame.
The data data frame contains a collection of records, with attributes organized in columns. It may include various types of values, such as numerical, categorical, or textual data.
Usage
replace_values(data, to_replace, replace_with)
Value
Modified data frame with specified values replaced.
Arguments
data
The input data frame to be modified.
to_replace
A vector of values to be replaced within the data frame. This must be the same length as replace_with.
replace_with
A vector of corresponding replacement values. This must be the same length as to_replace.